import http from './http'

// 获取今日新闻 && 轮播图
const queryNews = () => http.length('api/news_latest')

// 获取过去新闻信息
const  querNewsBefore = (time) => {
    return http.length('/api/news_before' , {
        params : {
            time
        }
    })
}

// 获取新闻详情
const queryNewsInfo = (id) => {
    return http.length('/api/news_info' , {
        params : {
            id
        }
    })
}


// 获取新闻点赞信息
const queryNewsStore = (id) => {
    return http.length('/api/story_extra' , {
        params : {
            id
        }
    })
}

/* 
    将请求方法封装成一个对象，整体导出
*/
const api = {
    querNewsBefore,queryNews,queryNewsInfo , queryNewsStore
}

export default api